package domain.entities;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Created with IntelliJ IDEA.
 * User: scamisay
 * Date: 9/26/12
 * Time: 6:07 AM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table
public class RoleNameProtocoloCompromisoPais {

    private Integer id;
    private Role role;
    private Involucrado involucrado;
    private boolean safety;
    private String otherRole;

    public RoleNameProtocoloCompromisoPais() {
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @OneToOne()
    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    @OneToOne(cascade = {CascadeType.MERGE, CascadeType.DETACH, CascadeType.PERSIST, CascadeType.REFRESH}, fetch = FetchType.EAGER)
    public Involucrado getInvolucrado() {
        return involucrado;
    }

    public void setInvolucrado(Involucrado involucrado) {
        this.involucrado = involucrado;
    }

    public boolean isSafety() {
        return safety;
    }

    public void setSafety(boolean safety) {
        this.safety = safety;
    }

    public String getOtherRole() {
        return otherRole;
    }

    public void setOtherRole(String otherRole) {
        this.otherRole = otherRole;
    }
}
